home *** CD-ROM | disk | FTP | other *** search
/ Cream of the Crop 1 / Cream of the Crop 1.iso / PROGRAM / EBKSRC.ARJ / PCKEY.CPP < prev    next >
C/C++ Source or Header  |  1991-07-30  |  936b  |  55 lines

  1. /*
  2.  
  3.     pckey.cpp
  4.     7-30-91
  5.     PC keyboard class for Borland C++
  6.  
  7.     Copyright 1991
  8.     John W. Small
  9.     All rights reserved
  10.     Use freely but acknowledge authorship and copyright.
  11.  
  12.  
  13.     PSW / Power SoftWare
  14.     P.O. Box 10072
  15.     McLean, Virginia 22102 8072 USA
  16.  
  17.     John Small
  18.     Voice: (703) 759-3838
  19.     CIS: 73757,2233
  20.  
  21. */
  22.  
  23. #include <pckey.hpp>
  24.  
  25. PCKey::PCKey()
  26. {
  27.     enhancedKeyBrd = 0;
  28.     flush();
  29.     (void) putch(0x3B00);
  30.     if (kbhit())  {
  31.     (void) getch();
  32.     enhancedKeyBrd = 0x10;
  33.     }
  34.     enhancedShiftMask = (enhancedKeyBrd)?
  35.     0xFFFF : 0x00FF;
  36.     asciiScan = 0;
  37.     fastTypeMaticExit = 0;
  38.     fastTypeMatic();
  39. }
  40.  
  41. void PCKey::flush(void)
  42. {
  43.     while (kbhit())
  44.     (void) getch();
  45. }
  46.  
  47. // PCKey static member definitions
  48. unsigned PCKey::asciiScan;
  49. unsigned char PCKey::enhancedKeyBrd;
  50. unsigned PCKey::enhancedShiftMask;
  51. unsigned PCKey::fastTypeMaticExit;
  52.  
  53. PCKey PCK;    // Only instance, do not instantiate!
  54.  
  55.